using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections.ObjectModel;
using VisualizationPackage;

namespace VisualUI
{
    public partial class frmVariables : Form
    {
        private string _selectedVariable;
        public string SelectedVariable
        {
            get
            {
                if (_selectedVariable == null)
                    _selectedVariable = Constants.X_Coord;
                return _selectedVariable;
            }
        }
        private ReadOnlyCollection<string> _dataSource;

        public ReadOnlyCollection<string> DataSource
        {
            get { return _dataSource; }
            set
            {
                _dataSource = value;
                cmbVariables.DataSource = _dataSource;
            }
        }

        public frmVariables()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            _selectedVariable = cmbVariables.Text;
            this.Close();
        }

        private void lnkCancel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}